/*
    YmsgIRC - Program enabling YMSG chat clients to use IRC
    Copyright (C) 2011 Crash Daemonicus ( crashenator -at- gmail.com )

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.h"
#include "IRC.h"
#include "YMSG.h"
#include "sockets_cross.h"

enum NetworkType
{
    NETWORK_IRC,
    NETWORK_YMSG
};
class Proxy
{
    public:
        static const int iNetworks=2;

        NwNetwork* networks[2];
        
        IRC irc;
        YMSG ymsg;
        
        
        Proxy();
        bool Startup();
        bool Shutdown();
        
        void notifyState(const string& state);
        void translateName(string& name,NwCheckType fromCheck,const NwNetwork& to,NetworkType typeTo);
        bool translateEvent(NwNotify& n,NwNetwork& from, NwNetwork& to,NetworkType typeFrom,NetworkType typeTo);
        
        bool eventsAvailable();
        
        void stepNetworks(NwStepState state);
        void stepEvents();
        bool stepsBegin();
        int step();
        void stepsEnd();
};
